/**
 * Created by chong on 2017/5/8.
 */
//不显示添加的页面
var add_control=new Array('/tableinfo/','/gameinfo/','/userrecharge/','/agentrecharge/','/feedback/','/agentbank/');

//不跳转修改的页面
var edit_control=new Array('/tableinfo/','/userrecharge/','/agentrecharge/','/agentbank/','/withdrawrecord/');
//不跳转删除的页面
var delete_control=new Array('/tableinfo/');
var cur_href = window.location.pathname;
function Check_AddControl() {
    //alert(cur_href);
    //alert($(".navbar-btn"));
    var t_ii = 0;
    for (var i = 0; i < add_control.length; i++) {
        t_ii = cur_href.indexOf(add_control[i]);
        //alert(t_ii);
        if (t_ii > 0) {
            //navbar-btn navbar-right hide-xs
            $(".navbar-btn").css('display', 'none');
            //alert(t_ii);
            //$("div.navbar-btn navbar-right hide-xs").hide();
            break;
        }
    }
}
function Check_EditControl() {
    //alert(cur_href);
    //alert($(".navbar-btn"));
    var t_ii = 0;
    for (var i = 0; i < edit_control.length; i++) {
        t_ii = cur_href.indexOf(edit_control[i]);
        //alert(t_ii);
        if (t_ii > 0) {
            //alert('ing...')
            $("table").find("tr").each(function(){

                var tdArr = $(this).children();
                //alert(tdArr.eq(1).children().length);//alert(123);
                //是否有单选框
                var ch_arr=tdArr.eq(0).children();
                var is_cb=0;
                for (var jj=0;jj<ch_arr.length;jj++)
                {//alert(ch_arr[jj].type);
                    if(ch_arr[jj].type=="checkbox")
                    {
                        is_cb=1;break;
                    }
                }
                //alert(is_cb);
                ch_arr=tdArr.eq(is_cb).children();
                if(ch_arr.length>=1)
                {//alert('oooo');
                    var a_html=ch_arr[ch_arr.length-1].innerHTML;
                    //ch_arr[ch_arr.length-1].href='#';
                    ch_arr[ch_arr.length-1].style.display='none';
                    tdArr.eq(is_cb).append(a_html);
                    //var a_html=ch_arr[ch_arr.length-1].html();//tdArr.eq(1).find("a").html();
                    //alert(a_html);
                }

            });

            break;
        }
    }
}
function Check_DeleteControl() {
    //alert(cur_href);
    //alert($(".navbar-btn"));
    var t_ii = 0;
    for (var i = 0; i < delete_control.length; i++) {
        t_ii = cur_href.indexOf(add_control[i]);
        //alert(t_ii);
        if (t_ii > 0) {
            //navbar-btn navbar-right hide-xs
            $(".fa fa-times").css('display', 'none');
            //alert(t_ii);
            //$("div.navbar-btn navbar-right hide-xs").hide();
            break;
        }
    }
}
function CheckControl()
{
    Check_AddControl();
    Check_EditControl();
    Check_DeleteControl();
}
CheckControl();